bdarmoryfandomcom-20200214-history
Physics
(This page will hopefully include information about any physics in the game including; Bullet flight characteristics, gun physics, and hopefully anything mentioned here. This is just a placeholder until there is enough information on the page to hopefully be able to take it down) Bullets In BD's armory, all guns shoot bullets that have finite speed and are affected by gravity. When a bullet impacts a target, it will add heat to the part that was hit depending on the impact tolerance of the part (hardness) and the angle of impact Source code: PooledBullet.cs, method FixedUpdate(). Usually, at Angle<5 degrees, the bullet will ricochet (making only 1/8 of normal damage) and at higher angles it will be a chance of ricochet vs penetration. When an automatic gun shoots, it will start to overheat with continuous firing. the overheat bar that the gun has when it starts firing is different to the total heat of the part, so even if the part is overheating from an outside source (Ex. getting shot or burned from a rocket), it will still be able to fire without overheating. Explosion damage This following is in common for the explosion of missiles, bombs, flak (Eg, Oerlikon cannon, Goalkeeper Ciws), and bullets that explode on impact (Eg, M230 Chain Gun Turret, M102 howitzer). The damage is primarily caused by an increased heat that may cause the explosion of the parts if it gets above the maximum allowed temperature. The heat added by explosions is inversely proportional to the parts impact tolerance. The damage also decreased by the square of the distance between the location of the explosion and the location of the part. On top of the heating effect an explosion will cause a force to be applied on the touched parts. This force will decrease by the square of the distance between the location of the explosion and the location of the part, the same as the heating effect does. It may cause the craft to be ripped apart if there are structural weaknesses. The exact formula for the heating is Source code: ExplosionFX.cs, method DoExplosionRay(): (BDArmorySettings.DMG_MULTIPLIER/100) * ExplosionHeatMultiplier * heat * ( 1 - sqrDist / sqrMaxDist ) / part.crashTolerance * BDArmorySettings.DMG_MULTIPLIER is a general setting * ExplosionHeatMultiplier is a constant * heat is a parameter that depends on the weapon. It's value is blastHeat when defined in the config file or defaults to blastPower otherwise * sqrMaxDist is the square value of the config parameter blastRadius * sqrDist is the square of the distance between the explosion and the part. * part.crashTolerance is the crash tolerance of the part The exact formula for the impulse (that is the outward force) is Source code: ExplosionFX.cs, method DoExplosionRay(): power * ( 1 - sqrDist / sqrMaxDist ) * ExplosionImpulseMultiplier * power ''is a parameter that depends on the weapon (the value of ''blastPower ''in the config files). * ''sqrMaxDist is the square value of the config parameter blastRadius * sqrDist is the square of the distance between the explosion and the part. * ExplosionImpulseMultiplier is a constant References Category:Tutorials